package com.cuicuisha.gxyp.user.service.impl;

import com.cuicuisha.gxyp.model.entity.user.AuthContextUtil;
import com.cuicuisha.gxyp.model.entity.user.UserAddress;
import com.cuicuisha.gxyp.user.mapper.UserAddressMapper;
import com.cuicuisha.gxyp.user.service.UserAddressService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * ClassName: UserAddressServiceImpl
 * Description:
 *
 * @Author 脆脆鲨
 * @Create 2024-09-23 11:23
 * @Version 1.0
 */
@Service
public class UserAddressServiceImpl implements UserAddressService {

    @Autowired
    private UserAddressMapper userAddressMapper;

    @Override
    public List<UserAddress> findUserAddressList() {
        return userAddressMapper.findByUserId(AuthContextUtil.getUser().getId());
    }

    @Override
    public UserAddress getById(Long id) {
        return userAddressMapper.getById(id);
    }
}
